package com.jiyun.wait.service.impl;

import com.jiyun.pojo.Personal;
import com.jiyun.pojo.UserPassenger;
import com.jiyun.pojo.chat.ChatMessage;
import com.jiyun.pojo.order.OrderInformation;
import com.jiyun.result.Result;
import com.jiyun.wait.mapper.ChatMessageMapper;
import com.jiyun.wait.service.ChatMessageService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChatMessageServiceImpl implements ChatMessageService {

    @Autowired
    private ChatMessageMapper chatMessageMapper;

    //查询所有消息
    @Override
    public Result selectMessage(ChatMessage chatMessage) {
        List<ChatMessage> chatMessageList=chatMessageMapper.selectMessage(chatMessage);
        return Result.ok(chatMessageList);
    }
    //查询乘客信息
    @Override
    public Result findPassenger(Personal personal) {
        Personal passenger1=chatMessageMapper.findPassenger(personal);
        return Result.ok(passenger1);
    }

    //将消息存储进去
    public int save(ChatMessage chatMessage){
        return chatMessageMapper.save(chatMessage);
    }


}
